﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace EventBus.Abstractions
{
    public interface IEventHandler
    {
        Task HandleAsync(IEvent @event,CancellationToken  cancellationToken=default(CancellationToken));
        bool CanHandle(IEvent @event);
    }
    public interface IEventHandler<T>
        :IEventHandler
        where T:IEvent
    {
        Task HandleAsync(T @event,CancellationToken cancellationToken= default(CancellationToken));
    }
}
